<?php

require_once '../function/connection.php';
connection();

$status = $_POST['dane'];
if($status == null){
    $status = 'niepotwierdzone';
}

$query = "SELECT * from `rezerwacje` where `rez_status` = '$status' ";


$result = mysql_query($query);



if( mysql_num_rows($result) == 0){
    return null;
}

echo '<div class="container"><table class="table table-striped table-bordered table-condensed">';
echo '<tr><td>Data</td><td>Godzina</td><td style="width:400px;">Opis</td><td>Status</td><td></td></tr>';
for ($i = 0; $i < mysql_num_rows($result); $i++) {
    $aReservations = mysql_fetch_assoc($result);
    
    
    echo '<tr>';
    echo '<td>'.$aReservations["rez_data"].'</td>'.'<td>'.$aReservations["rez_godzina"].'</td>'.'<td>'.$aReservations["rez_opis"].'</td>'.'<td>'.$aReservations["rez_status"].'</td><td><a class="btn" href="/view/admin_booking_view.php?id='.$aReservations['rez_1_id'].'">Edytuj status zlecenia</a></td>';
    echo '</tr>';
}

echo '</table></div>';







//$query = "UPDATE  `rezerwacje` SET  `rez_status` = 'zaakceptowane' WHERE `rez_1_id` = '$sesja';";
//    if(isset($_GET['id'])){
//        $sesja = $_GET['id'];
//    
//        
//
//    }
?>


